Micron Document
pintobyte rngit

xous-core/services/ticktimer-test-client/src/main.rs main (17e4bce8) Text, 1.06 KB

#![cfg_attr(target_os = "none", no_std)]
#![cfg_attr(target_os = "none", no_main)]

use std::thread::sleep;
use std::time::Duration;

use log::info;

fn main() -> ! {
log_server::init_wait().unwrap();
log::set_max_level(log::LevelFilter::Trace);
info!("my PID is {}", xous::process::id());

#[cfg(feature = "susres-testing")]
const DELAY_MS: u64 = 2000;
#[cfg(not(feature = "susres-testing"))]
const DELAY_MS: u64 = 5000;

#[cfg(feature = "susres-testing")]
let xns = xous_names::XousNames::new().unwrap();
#[cfg(feature = "susres-testing")]
let susres = susres::Susres::new_without_hook(&xns).unwrap();

for i in 0.. {
info!("Loop #{}, waiting {} ms", i, DELAY_MS);
sleep(Duration::from_millis(DELAY_MS));
#[cfg(feature = "susres-testing")]
{
info!("initiate suspend");
susres.initiate_suspend().unwrap();
info!("after suspend, sleeping");
sleep(Duration::from_millis(DELAY_MS));
}
}

panic!("Finished endless loop");
}

Served by rngit 1.4.0 - Generated in 0.05s